package cn.scau.server.service;

import cn.scau.server.pojo.Notice;
import cn.scau.server.vo.ResultVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 代码不跑我先跑
 * @since 2025-03-30
 */
public interface NoticeService extends IService<Notice> {

    @Transactional
    ResultVO<Notice> publishNotice(String title, String content, Integer status, Integer deptId);

    ResultVO<Page<Notice>> getPublishedNotices(Integer id, String title, String startDate, String endDate, Integer deptId, Integer pageNum, Integer pageSize);

    ResultVO<Page<Notice>> getDraftNotices(Integer id, String title, Integer status, Integer deptId, Integer pageNum, Integer pageSize);

    @Transactional
    ResultVO<Notice> editNotice(Integer id, Integer deptId, String title, String content);

    @Transactional
    ResultVO<Notice> changeNoticeStatus(Integer id, Integer status);

    @Transactional
    ResultVO deleteNotice(Integer id);

    ResultVO<Notice> viewNoticeContent(Integer id);
}
